<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
  <title>Overbyte ICS Web Application Server Demo - Login</title>
  <script type="text/javascript" src="/js/md5.js"></script>
</head>

<body>
  <table>
    <tr>
      <td><img SRC="/images/Logo.png"></td>
      <td><h1>Overbyte ICS<br>Web Application Server Demo</h1></td>
    </tr>
  </table>
  <br><br><br>
  <script type="text/javascript">
    function DoLogin()
    {
      Challenge    = LoginForm.elements[0].value;
      UserCode     = LoginForm.elements[1].value;
      Password     = LoginForm.elements[2].value;
      PasswordHash = hex_md5(Challenge + Password.toUpperCase());
      LoginParam.elements[0].value = UserCode;
      LoginParam.elements[1].value = PasswordHash;
      LoginParam.submit();
      return false;
    }
  </script>
  <form name="LoginParam" action="<#DoLoginSecure>" method="GET">
    <input name="UserCode"     type="hidden">
    <input name="PasswordHash" type="hidden">
  </form>

  <form action="/JavascriptError.html" name="LoginForm" method="get">
    <input name="Challenge" type="hidden" value="<#Challenge>">
    <table>
      <tr><td>Usercode:  </td>
          <td><input name="UserCode" type="text"
                     value= "<#UserCode>"></td>
          <td>(Anything accepted in the demo)</td></tr>
      <tr><td>Password: </td>
          <td><input name="Password" type="password" value= ""></td>
          <td>(Demo password is "admin")</td></tr>
      <tr><td>&nbsp;  </td>
          <td><input type="submit" value="Login"
                     onClick="return DoLogin();"></td><td></td></tr>
    </table>
  </form>
  <hr>
  <div align="center">
    <img src="<#COUNTER>?ref=LoginForm">
  </div>
</body>
</html>

